<!-- HTML header for doxygen 1.8.5-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>MyoKit 0.4.0: TLHMViewController.m</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="customdoxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<div id="projectnumber">MyoKit &ndash; 0.4.0</div>
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img src="logo-black.png"/></td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_t_l_h_m_view_controller_8m-example.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Properties</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">TLHMViewController.m</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">//  TLHMViewController.m</span></div>
<div class="line"><span class="comment">//  HelloMyo</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">//  Copyright (c) 2013 Thalmic Labs. All rights reserved.</span></div>
<div class="line"><span class="comment">//  Distributed under the Myo SDK license agreement. See LICENSE.txt.</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#import &quot;TLHMViewController.h&quot;</span></div>
<div class="line"><span class="preprocessor">#import &lt;MyoKit/MyoKit.h&gt;</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">@interface </span>TLHMViewController ()</div>
<div class="line"></div>
<div class="line"><span class="keyword">@property</span> (weak, nonatomic) IBOutlet UILabel *helloLabel;</div>
<div class="line"><span class="keyword">@property</span> (weak, nonatomic) IBOutlet UIProgressView *accelerationProgressBar;</div>
<div class="line"><span class="keyword">@property</span> (weak, nonatomic) IBOutlet UILabel *accelerationLabel;</div>
<div class="line"><span class="keyword">@property</span> (weak, nonatomic) IBOutlet UILabel *armLabel;</div>
<div class="line"><span class="keyword">@property</span> (weak, nonatomic) IBOutlet UILabel *lockLabel;</div>
<div class="line"><span class="keyword">@property</span> (strong, nonatomic) <a name="_a0"></a><a class="code" href="interface_t_l_m_pose.html">TLMPose</a> *currentPose;</div>
<div class="line"></div>
<div class="line">- (IBAction)didTapSettings:(<span class="keywordtype">id</span>)sender;</div>
<div class="line"></div>
<div class="line"><span class="keyword">@end</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">@implementation </span>TLHMViewController</div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#pragma mark - View Lifecycle</span></div>
<div class="line"><span class="preprocessor"></span></div>
<div class="line">- (id)init {</div>
<div class="line">    <span class="comment">// Initialize our view controller with a nib (see TLHMViewController.xib).</span></div>
<div class="line">    <span class="keyword">self</span> = [<span class="keyword">super</span> initWithNibName:@&quot;TLHMViewController&quot; bundle:nil];</div>
<div class="line">    <span class="keywordflow">return</span> <span class="keyword">self</span>;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (void)viewDidLoad {</div>
<div class="line">    [<span class="keyword">super</span> viewDidLoad];</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Data notifications are received through NSNotificationCenter.</span></div>
<div class="line">    <span class="comment">// Posted whenever a TLMMyo connects</span></div>
<div class="line">    [[NSNotificationCenter defaultCenter] addObserver:self</div>
<div class="line">                                             selector:@selector(didConnectDevice:)</div>
<div class="line">                                                 name:TLMHubDidConnectDeviceNotification</div>
<div class="line">                                               object:nil];</div>
<div class="line">    <span class="comment">// Posted whenever a TLMMyo disconnects.</span></div>
<div class="line">    [[NSNotificationCenter defaultCenter] addObserver:self</div>
<div class="line">                                             selector:@selector(didDisconnectDevice:)</div>
<div class="line">                                                 name:TLMHubDidDisconnectDeviceNotification</div>
<div class="line">                                               object:nil];</div>
<div class="line">    <span class="comment">// Posted whenever the user does a successful Sync Gesture.</span></div>
<div class="line">    [[NSNotificationCenter defaultCenter] addObserver:self</div>
<div class="line">                                             selector:@selector(didSyncArm:)</div>
<div class="line">                                                 name:TLMMyoDidReceiveArmSyncEventNotification</div>
<div class="line">                                               object:nil];</div>
<div class="line">    <span class="comment">// Posted whenever Myo loses sync with an arm (when Myo is taken off, or moved enough on the user&#39;s arm).</span></div>
<div class="line">    [[NSNotificationCenter defaultCenter] addObserver:self</div>
<div class="line">                                             selector:@selector(didUnsyncArm:)</div>
<div class="line">                                                 name:TLMMyoDidReceiveArmUnsyncEventNotification</div>
<div class="line">                                               object:nil];</div>
<div class="line">    <span class="comment">// Posted whenever Myo is unlocked and the application uses TLMLockingPolicyStandard.</span></div>
<div class="line">    [[NSNotificationCenter defaultCenter] addObserver:self</div>
<div class="line">                                             selector:@selector(didUnlockDevice:)</div>
<div class="line">                                                 name:TLMMyoDidReceiveUnlockEventNotification</div>
<div class="line">                                               object:nil];</div>
<div class="line">    <span class="comment">// Posted whenever Myo is locked and the application uses TLMLockingPolicyStandard.</span></div>
<div class="line">    [[NSNotificationCenter defaultCenter] addObserver:self</div>
<div class="line">                                             selector:@selector(didLockDevice:)</div>
<div class="line">                                                 name:TLMMyoDidReceiveLockEventNotification</div>
<div class="line">                                               object:nil];</div>
<div class="line">    <span class="comment">// Posted when a new orientation event is available from a TLMMyo. Notifications are posted at a rate of 50 Hz.</span></div>
<div class="line">    [[NSNotificationCenter defaultCenter] addObserver:self</div>
<div class="line">                                             selector:@selector(didReceiveOrientationEvent:)</div>
<div class="line">                                                 name:TLMMyoDidReceiveOrientationEventNotification</div>
<div class="line">                                               object:nil];</div>
<div class="line">    <span class="comment">// Posted when a new accelerometer event is available from a TLMMyo. Notifications are posted at a rate of 50 Hz.</span></div>
<div class="line">    [[NSNotificationCenter defaultCenter] addObserver:self</div>
<div class="line">                                             selector:@selector(didReceiveAccelerometerEvent:)</div>
<div class="line">                                                 name:TLMMyoDidReceiveAccelerometerEventNotification</div>
<div class="line">                                               object:nil];</div>
<div class="line">    <span class="comment">// Posted when a new pose is available from a TLMMyo.</span></div>
<div class="line">    [[NSNotificationCenter defaultCenter] addObserver:self</div>
<div class="line">                                             selector:@selector(didReceivePoseChange:)</div>
<div class="line">                                                 name:TLMMyoDidReceivePoseChangedNotification</div>
<div class="line">                                               object:nil];</div>
<div class="line"></div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (void)didReceiveMemoryWarning {</div>
<div class="line">    [<span class="keyword">super</span> didReceiveMemoryWarning];</div>
<div class="line">    <span class="comment">// Dispose of any resources that can be recreated.</span></div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#pragma mark - NSNotificationCenter Methods</span></div>
<div class="line"><span class="preprocessor"></span></div>
<div class="line">- (void)didConnectDevice:(NSNotification *)notification {</div>
<div class="line">    <span class="comment">// Align our label to be in the center of the view.</span></div>
<div class="line">    [<span class="keyword">self</span>.helloLabel setCenter:self.view.center];</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Set the text of the armLabel to &quot;Perform the Sync Gesture&quot;.</span></div>
<div class="line">    <span class="keyword">self</span>.armLabel.text = <span class="stringliteral">@&quot;Perform the Sync Gesture&quot;</span>;</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Set the text of our helloLabel to be &quot;Hello Myo&quot;.</span></div>
<div class="line">    <span class="keyword">self</span>.helloLabel.text = <span class="stringliteral">@&quot;Hello Myo&quot;</span>;</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Show the acceleration progress bar</span></div>
<div class="line">    [<span class="keyword">self</span>.accelerationProgressBar setHidden:NO];</div>
<div class="line">    [<span class="keyword">self</span>.accelerationLabel setHidden:NO];</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (void)didDisconnectDevice:(NSNotification *)notification {</div>
<div class="line">    <span class="comment">// Remove the text from our labels when the Myo has disconnected.</span></div>
<div class="line">    <span class="keyword">self</span>.helloLabel.text = <span class="stringliteral">@&quot;&quot;</span>;</div>
<div class="line">    <span class="keyword">self</span>.armLabel.text = <span class="stringliteral">@&quot;&quot;</span>;</div>
<div class="line">    <span class="keyword">self</span>.lockLabel.text = <span class="stringliteral">@&quot;&quot;</span>;</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Hide the acceleration progress bar.</span></div>
<div class="line">    [<span class="keyword">self</span>.accelerationProgressBar setHidden:YES];</div>
<div class="line">    [<span class="keyword">self</span>.accelerationLabel setHidden:YES];</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (void)didUnlockDevice:(NSNotification *)notification {</div>
<div class="line">    <span class="comment">// Update the label to reflect Myo&#39;s lock state.</span></div>
<div class="line">    <span class="keyword">self</span>.lockLabel.text = <span class="stringliteral">@&quot;Unlocked&quot;</span>;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (void)didLockDevice:(NSNotification *)notification {</div>
<div class="line">    <span class="comment">// Update the label to reflect Myo&#39;s lock state.</span></div>
<div class="line">    <span class="keyword">self</span>.lockLabel.text = <span class="stringliteral">@&quot;Locked&quot;</span>;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (void)didSyncArm:(NSNotification *)notification {</div>
<div class="line">    <span class="comment">// Retrieve the arm event from the notification&#39;s userInfo with the kTLMKeyArmSyncEvent key.</span></div>
<div class="line">    <a name="_a1"></a><a class="code" href="interface_t_l_m_arm_sync_event.html">TLMArmSyncEvent</a> *armEvent = notification.userInfo[kTLMKeyArmSyncEvent];</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Update the armLabel with arm information.</span></div>
<div class="line">    NSString *armString = armEvent.<a name="a2"></a><a class="code" href="interface_t_l_m_arm_sync_event.html#a1e03ba3302699d650551a8be4cd956ce">arm</a> == TLMArmRight ? <span class="stringliteral">@&quot;Right&quot;</span> : <span class="stringliteral">@&quot;Left&quot;</span>;</div>
<div class="line">    NSString *directionString = armEvent.<a name="a3"></a><a class="code" href="interface_t_l_m_arm_sync_event.html#a615db59a0a3738fce24cd4c47a6f96a3">xDirection</a> == TLMArmXDirectionTowardWrist ? <span class="stringliteral">@&quot;Toward Wrist&quot;</span> : <span class="stringliteral">@&quot;Toward Elbow&quot;</span>;</div>
<div class="line">    <span class="keyword">self</span>.armLabel.text = [NSString stringWithFormat:@&quot;Arm: %@ X-Direction: %@&quot;, armString, directionString];</div>
<div class="line">    <span class="keyword">self</span>.lockLabel.text = <span class="stringliteral">@&quot;Locked&quot;</span>;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (void)didUnsyncArm:(NSNotification *)notification {</div>
<div class="line">    <span class="comment">// Reset the labels.</span></div>
<div class="line">    <span class="keyword">self</span>.armLabel.text = <span class="stringliteral">@&quot;Perform the Sync Gesture&quot;</span>;</div>
<div class="line">    <span class="keyword">self</span>.helloLabel.text = <span class="stringliteral">@&quot;Hello Myo&quot;</span>;</div>
<div class="line">    <span class="keyword">self</span>.lockLabel.text = <span class="stringliteral">@&quot;&quot;</span>;</div>
<div class="line">    <span class="keyword">self</span>.helloLabel.font = [UIFont fontWithName:@&quot;Helvetica Neue&quot; size:50];</div>
<div class="line">    <span class="keyword">self</span>.helloLabel.textColor = [UIColor blackColor];</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (void)didReceiveOrientationEvent:(NSNotification *)notification {</div>
<div class="line">    <span class="comment">// Retrieve the orientation from the NSNotification&#39;s userInfo with the kTLMKeyOrientationEvent key.</span></div>
<div class="line">    <a name="_a4"></a><a class="code" href="interface_t_l_m_orientation_event.html">TLMOrientationEvent</a> *orientationEvent = notification.userInfo[kTLMKeyOrientationEvent];</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Create Euler angles from the quaternion of the orientation.</span></div>
<div class="line">    <a name="_a5"></a><a class="code" href="interface_t_l_m_euler_angles.html">TLMEulerAngles</a> *angles = [<a class="code" href="interface_t_l_m_euler_angles.html">TLMEulerAngles</a> <a class="code" href="interface_t_l_m_euler_angles.html#ac1f20991cf85e590c7d2c0fd1cff32cd">anglesWithQuaternion</a>:orientationEvent.quaternion];</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Next, we want to apply a rotation and perspective transformation based on the pitch, yaw, and roll.</span></div>
<div class="line">    CATransform3D rotationAndPerspectiveTransform = CATransform3DConcat(CATransform3DConcat(CATransform3DRotate (CATransform3DIdentity, angles.<a name="a6"></a><a class="code" href="interface_t_l_m_euler_angles.html#a4d9040c1c5c5d14eed71c80c82e85765">pitch</a>.<a name="a7"></a><a class="code" href="interface_t_l_m_angle.html#a1cdfede1c67bfae83ac622da174501b8">radians</a>, -1.0, 0.0, 0.0), CATransform3DRotate(CATransform3DIdentity, angles.<a name="a8"></a><a class="code" href="interface_t_l_m_euler_angles.html#a36b85cd03a00d4b75fcb61ae28c4f308">yaw</a>.<a class="code" href="interface_t_l_m_angle.html#a1cdfede1c67bfae83ac622da174501b8">radians</a>, 0.0, 1.0, 0.0)), CATransform3DRotate(CATransform3DIdentity, angles.<a name="a9"></a><a class="code" href="interface_t_l_m_euler_angles.html#a70dea082d7777b03958ad221216201e7">roll</a>.<a class="code" href="interface_t_l_m_angle.html#a1cdfede1c67bfae83ac622da174501b8">radians</a>, 0.0, 0.0, -1.0));</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Apply the rotation and perspective transform to helloLabel.</span></div>
<div class="line">    <span class="keyword">self</span>.helloLabel.layer.transform = rotationAndPerspectiveTransform;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (void)didReceiveAccelerometerEvent:(NSNotification *)notification {</div>
<div class="line">    <span class="comment">// Retrieve the accelerometer event from the NSNotification&#39;s userInfo with the kTLMKeyAccelerometerEvent.</span></div>
<div class="line">    <a name="_a10"></a><a class="code" href="interface_t_l_m_accelerometer_event.html">TLMAccelerometerEvent</a> *accelerometerEvent = notification.userInfo[kTLMKeyAccelerometerEvent];</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Get the acceleration vector from the accelerometer event.</span></div>
<div class="line">    <a name="_a11"></a><a class="code" href="struct___t_l_m_vector3.html">TLMVector3</a> accelerationVector = accelerometerEvent.<a name="a12"></a><a class="code" href="interface_t_l_m_accelerometer_event.html#a432258da57c8b280c7a942d3b9f8eb4a">vector</a>;</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Calculate the magnitude of the acceleration vector.</span></div>
<div class="line">    <span class="keywordtype">float</span> magnitude = TLMVector3Length(accelerationVector);</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Update the progress bar based on the magnitude of the acceleration vector.</span></div>
<div class="line">    <span class="keyword">self</span>.accelerationProgressBar.progress = magnitude / 8;</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* Note you can also access the x, y, z values of the acceleration (in G&#39;s) like below</span></div>
<div class="line"><span class="comment">     float x = accelerationVector.x;</span></div>
<div class="line"><span class="comment">     float y = accelerationVector.y;</span></div>
<div class="line"><span class="comment">     float z = accelerationVector.z;</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (void)didReceivePoseChange:(NSNotification *)notification {</div>
<div class="line">    <span class="comment">// Retrieve the pose from the NSNotification&#39;s userInfo with the kTLMKeyPose key.</span></div>
<div class="line">    <a class="code" href="interface_t_l_m_pose.html">TLMPose</a> *pose = notification.userInfo[kTLMKeyPose];</div>
<div class="line">    <span class="keyword">self</span>.currentPose = pose;</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Handle the cases of the TLMPoseType enumeration, and change the color of helloLabel based on the pose we receive.</span></div>
<div class="line">    <span class="keywordflow">switch</span> (pose.<a name="a13"></a><a class="code" href="interface_t_l_m_pose.html#a16841d7ca84dd0a9eb2703df48b14d3a">type</a>) {</div>
<div class="line">        <span class="keywordflow">case</span> TLMPoseTypeUnknown:</div>
<div class="line">        <span class="keywordflow">case</span> TLMPoseTypeRest:</div>
<div class="line">        <span class="keywordflow">case</span> TLMPoseTypeDoubleTap:</div>
<div class="line">            <span class="comment">// Changes helloLabel&#39;s font to Helvetica Neue when the user is in a rest or unknown pose.</span></div>
<div class="line">            <span class="keyword">self</span>.helloLabel.text = <span class="stringliteral">@&quot;Hello Myo&quot;</span>;</div>
<div class="line">            <span class="keyword">self</span>.helloLabel.font = [UIFont fontWithName:@&quot;Helvetica Neue&quot; size:50];</div>
<div class="line">            <span class="keyword">self</span>.helloLabel.textColor = [UIColor blackColor];</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> TLMPoseTypeFist:</div>
<div class="line">            <span class="comment">// Changes helloLabel&#39;s font to Noteworthy when the user is in a fist pose.</span></div>
<div class="line">            <span class="keyword">self</span>.helloLabel.text = <span class="stringliteral">@&quot;Fist&quot;</span>;</div>
<div class="line">            <span class="keyword">self</span>.helloLabel.font = [UIFont fontWithName:@&quot;Noteworthy&quot; size:50];</div>
<div class="line">            <span class="keyword">self</span>.helloLabel.textColor = [UIColor greenColor];</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> TLMPoseTypeWaveIn:</div>
<div class="line">            <span class="comment">// Changes helloLabel&#39;s font to Courier New when the user is in a wave in pose.</span></div>
<div class="line">            <span class="keyword">self</span>.helloLabel.text = <span class="stringliteral">@&quot;Wave In&quot;</span>;</div>
<div class="line">            <span class="keyword">self</span>.helloLabel.font = [UIFont fontWithName:@&quot;Courier New&quot; size:50];</div>
<div class="line">            <span class="keyword">self</span>.helloLabel.textColor = [UIColor greenColor];</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> TLMPoseTypeWaveOut:</div>
<div class="line">            <span class="comment">// Changes helloLabel&#39;s font to Snell Roundhand when the user is in a wave out pose.</span></div>
<div class="line">            <span class="keyword">self</span>.helloLabel.text = <span class="stringliteral">@&quot;Wave Out&quot;</span>;</div>
<div class="line">            <span class="keyword">self</span>.helloLabel.font = [UIFont fontWithName:@&quot;Snell Roundhand&quot; size:50];</div>
<div class="line">            <span class="keyword">self</span>.helloLabel.textColor = [UIColor greenColor];</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">        <span class="keywordflow">case</span> TLMPoseTypeFingersSpread:</div>
<div class="line">            <span class="comment">// Changes helloLabel&#39;s font to Chalkduster when the user is in a fingers spread pose.</span></div>
<div class="line">            <span class="keyword">self</span>.helloLabel.text = <span class="stringliteral">@&quot;Fingers Spread&quot;</span>;</div>
<div class="line">            <span class="keyword">self</span>.helloLabel.font = [UIFont fontWithName:@&quot;Chalkduster&quot; size:50];</div>
<div class="line">            <span class="keyword">self</span>.helloLabel.textColor = [UIColor greenColor];</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="comment">// Unlock the Myo whenever we receive a pose</span></div>
<div class="line">    <span class="keywordflow">if</span> (pose.<a class="code" href="interface_t_l_m_pose.html#a16841d7ca84dd0a9eb2703df48b14d3a">type</a> == TLMPoseTypeUnknown || pose.<a class="code" href="interface_t_l_m_pose.html#a16841d7ca84dd0a9eb2703df48b14d3a">type</a> == TLMPoseTypeRest) {</div>
<div class="line">        <span class="comment">// Causes the Myo to lock after a short period.</span></div>
<div class="line">        [pose.myo unlockWithType:TLMUnlockTypeTimed];</div>
<div class="line">    } <span class="keywordflow">else</span> {</div>
<div class="line">        <span class="comment">// Keeps the Myo unlocked until specified.</span></div>
<div class="line">        <span class="comment">// This is required to keep Myo unlocked while holding a pose, but if a pose is not being held, use</span></div>
<div class="line">        <span class="comment">// TLMUnlockTypeTimed to restart the timer.</span></div>
<div class="line">        [pose.myo unlockWithType:TLMUnlockTypeHold];</div>
<div class="line">        <span class="comment">// Indicates that a user action has been performed.</span></div>
<div class="line">        [pose.myo indicateUserAction];</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">- (IBAction)didTapSettings:(<span class="keywordtype">id</span>)sender {</div>
<div class="line">    <span class="comment">// Note that when the settings view controller is presented to the user, it must be in a UINavigationController.</span></div>
<div class="line">    UINavigationController *controller = [<a class="code" href="interface_t_l_m_settings_view_controller.html">TLMSettingsViewController</a> <a class="code" href="interface_t_l_m_settings_view_controller.html#a4fcb5b8989223e1178ea3fbfd32fd232">settingsInNavigationController</a>];</div>
<div class="line">    <span class="comment">// Present the settings view controller modally.</span></div>
<div class="line">    [<span class="keyword">self</span> presentViewController:controller animated:YES completion:nil];</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="keyword">@end</span></div>
</div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2013 Thalmic Labs Inc. Confidential and not for redistribution. See LICENSE.txt.</li>
  </ul>
</div>
</body>
</html>
